<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function Person(name, age) {
            this.name = name;
            this.age = age;
        };

        Person.prototype.showname = function() {
            return `名字是${this.name}`
        };

        Person.prototype.showage = function() {
            return `我的年龄${this.age}`
        };


        let p1 = new Person('小名', 10);
        console.log(p1.showname());
        console.log(p1.showage());
    </script>
</body>

</html>